
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main.xhtml">

	<ui:define name="body">
		<h:form prependId="false">

			<p:toolbar>
				<p:toolbarGroup align="left">
					<p:commandButton value="#{messages['button.save']}" action="#{obraEditMB.insert}"
						rendered="#{!obraEditMB.updateMode}" ajax="false" />
					<p:commandButton value="#{messages['button.save']}" action="#{obraEditMB.update}"
						rendered="#{obraEditMB.updateMode}" ajax="false" />
					<p:commandButton value="#{messages['button.delete']}" onclick="confirmation.show()"
						rendered="#{obraEditMB.updateMode}" type="button" immediate="true" ajax="false" />
					<p:confirmDialog message="#{messages['label.confirm.delete']}" showEffect="bounce" hideEffect="explode"
						header="#{messages['label.dialog.delete']}" severity="alert" widgetVar="confirmation">
						<h:commandButton value="#{messages['button.dialog.yes']}" action="#{obraEditMB.delete}" immediate="true"
							ajax="false" />
						<h:commandButton value="#{messages['button.dialog.no']}" onclick="confirmation.hide()" type="button" />
					</p:confirmDialog>
				</p:toolbarGroup>
			</p:toolbar>

			<br />

			<p:fieldset legend="#{messages['obra.label.dadosGerais']}" toggleable="true" toggleSpeed="500">
				<h:panelGrid columns="2">
					<h:outputLabel value="#{messages['obra.label.id']}: " for="id" styleClass="text-input" />
					<h:panelGrid columns="2">
				        <h:outputText id="id" value="#{obraEditMB.bean.id}" />
				        <p:message for="id" />
			        </h:panelGrid>

			        <h:outputLabel value="#{messages['obra.label.titulo']}: " for="titulo" styleClass="text-input" />
					<h:panelGrid columns="5">
				    	<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="titulo" value="#{obraEditMB.bean.titulo}" title="#{messages['obra.alt.titulo']}" size="60" />
				    	<p:message for="titulo" />
				    	<h:outputLabel value="#{messages['obra.label.anoExercicio']}: " for="anoExercicio" styleClass="text-input" /> 
				    	<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="anoExercicio" value="#{obraEditMB.bean.anoExercicio}" title="#{messages['obra.alt.anoExercicio']}" size="4" maxlength="4" />
				    	<p:message for="anoExercicio" />
			        </h:panelGrid>

					<h:outputLabel value="#{messages['obra.label.localizacao']}: " for="localizacao" styleClass="text-input" />
					<h:panelGrid columns="2">
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="localizacao" value="#{obraEditMB.bean.localizacao}" title="#{messages['obra.alt.localizacao']}" size="100" />
						<p:message for="localizacao" />
					</h:panelGrid>   	

					<h:outputLabel value="#{messages['obra.label.unidadeOrcamentaria']}: " for="unidadeOrcamentaria" styleClass="text-input" />
					<h:panelGrid columns="5">
						<h:selectOneMenu value="#{obraEditMB.unidadeOrcamentaria}" id="unidadeOrcamentaria" style="width: 350px;"
							title="#{messages['obra.label.unidadeOrcamentaria']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.unidadeOrcamentarias}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="unidadeOrcamentaria" />
	
						<h:outputLabel value="#{messages['obra.label.unidadeExecutora']}: " for="unidadeExecutora" styleClass="text-input" />
						<h:selectOneMenu value="#{obraEditMB.unidadeExecutora}" id="unidadeExecutora" style="width: 350px;"
							title="#{messages['obra.label.unidadeExecutora']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.unidadeOrcamentarias}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="unidadeExecutora" />
					</h:panelGrid>
			    	
			    	<h:outputLabel value="#{messages['obra.label.dimensaoBasica']}: " for="dimensaoBasica" styleClass="text-input" />
			    	<h:panelGrid columns="11">
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="dimensaoBasica" value="#{obraEditMB.bean.dimensaoBasica}" size="10"
							title="#{messages['obra.alt.dimensaoBasica']}" />
						<p:message for="dimensaoBasica" />
	
						<h:outputLabel value="#{messages['obra.label.unidadeMedida']}: " for="unidadeMedida" styleClass="text-input" />
						<h:selectOneMenu value="#{obraEditMB.unidadeMedida}" id="unidadeMedida" style="width: 50px;"
							title="#{messages['obra.label.unidadeMedida']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.unidadeMedidas}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="unidadeMedida" />
						
						<h:outputLabel value="#{messages['obra.label.tipoPrazoObra']}: " for="tipoPrazo" styleClass="text-input" />
						<h:selectOneMenu value="#{obraEditMB.tipoPrazo}" id="tipoPrazo" style="width: 50px;"
							title="#{messages['obra.label.tipoPrazoObra']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.tipoPrazos}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="tipoPrazo" />
	
						<h:outputLabel value="#{messages['obra.label.prazoExecucao']}: " for="prazoExecucao" styleClass="text-input" />
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="prazoExecucao" value="#{obraEditMB.bean.prazoExecucao}" size="5"
							title="#{messages['obra.alt.prazoExecucao']}" />
						<p:message for="prazoExecucao" />
					</h:panelGrid>   	
					
					<h:outputLabel value="#{messages['obra.label.projetoAtividade']}: " for="projetoAtividade" styleClass="text-input" />
					<h:panelGrid columns="2">
						<h:selectOneMenu value="#{obraEditMB.projetoAtividade}" id="projetoAtividade" style="width: 550px;"
							title="#{messages['obra.label.projetoAtividade']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.projetoAtividades}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="projetoAtividade" />
					</h:panelGrid>   	
					
					<h:outputLabel value="#{messages['obra.label.despesa']}: " for="despesa" styleClass="text-input" />
					<h:panelGrid columns="2">
						<h:selectOneMenu value="#{obraEditMB.despesa}" id="despesa" style="width: 470px;"
							title="#{messages['obra.label.despesa']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.despesas}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="despesa" />
					</h:panelGrid>   	
					
					<h:outputLabel value="#{messages['obra.label.formaExecucao']}: " for="formaExecucao" styleClass="text-input" />
					<h:panelGrid columns="8">
						<h:selectOneMenu value="#{obraEditMB.formaExecucao}" id="formaExecucao" style="width: 150px;"
							title="#{messages['obra.label.formaExecucao']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.formaExecucaos}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="formaExecucao" />

						<h:outputLabel value="#{messages['obra.label.indDispensaLicitacao']}: " for="indDispensaLicitacao" styleClass="text-input" />
						<h:selectOneRadio styleClass="tableRadios" id="indDispensaLicitacao" value="#{obraEditMB.bean.indDispensaLicitacao}" 
					    	required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">  
				             <f:selectItem itemLabel="Sim" itemValue="1" />
				             <f:selectItem itemLabel="Não" itemValue="0" />
				         </h:selectOneRadio>

						<p:message for="indDispensaLicitacao" />

					</h:panelGrid>   	
					
					<h:outputLabel value="#{messages['obra.label.nomeEngenheiro']}: " for="nomeEngenheiro" styleClass="text-input" />
					<h:panelGrid columns="8">
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="nomeEngenheiro" value="#{obraEditMB.bean.nomeEngenheiro}"
							title="#{messages['obra.alt.nomeEngenheiro']}" />
						<p:message for="nomeEngenheiro" />

						<h:outputLabel value="#{messages['obra.label.ufEngenheiro']}: " for="estado" styleClass="text-input" />

						<h:selectOneMenu value="#{obraEditMB.estado}" id="estado" style="width: 100px;"
							title="#{messages['obra.label.ufEngenheiro']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.estados}"></f:selectItems>
						</h:selectOneMenu>
						<p:message for="estado" />

						<h:outputLabel value="#{messages['obra.label.creaEngenheiro']}: " for="creaEngenheiro" styleClass="text-input" />
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="creaEngenheiro" value="#{obraEditMB.bean.creaEngenheiro}"
							title="#{messages['obra.alt.creaEngenheiro']}" />
						<p:message for="creaEngenheiro" />
					</h:panelGrid>   	

					<h:outputLabel value="#{messages['obra.label.valorTotalItem']}: " for="valorTotalItem" styleClass="text-input" />
					<h:panelGrid columns="5">
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="valorTotalItem" value="#{obraEditMB.bean.valorTotalItem}"
							title="#{messages['obra.alt.valorTotalItem']}" />
						<p:message for="valorTotalItem" />
						<h:outputLabel value="#{messages['obra.label.valorObra']}: " for="valorObra" styleClass="text-input" />
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="valorObra" value="#{obraEditMB.bean.valorObra}"
							title="#{messages['obra.alt.valorObra']}" />
						<p:message for="valorObra" />
					</h:panelGrid>   	
					
					<h:outputLabel value="#{messages['obra.label.fonteRecursos']}: " for="fonteRecursos" styleClass="text-input" />
					<h:panelGrid columns="8">
						<h:selectOneRadio styleClass="tableRadios" id="fonteRecursos" value="#{obraEditMB.bean.fonteRecursos}" 
					    	required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">  
				             <f:selectItem itemLabel="Próprio" itemValue="1" />
				             <f:selectItem itemLabel="Convênio" itemValue="2" />
				             <f:selectItem itemLabel="Ambos (Próprio + Convênio)" itemValue="3" />
				             <f:selectItem itemLabel="Outros" itemValue="4" />
				         </h:selectOneRadio>
						<p:message for="fonteRecursos" />
						<h:outputLabel value="#{messages['obra.label.nomeEntidade']}: " for="nomeEntidade" styleClass="text-input" />
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="nomeEntidade" value="#{obraEditMB.bean.nomeEntidade}" size="10"  
							title="#{messages['obra.alt.nomeEntidade']}" />
						<p:message for="nomeEntidade" />
						<h:outputLabel value="#{messages['obra.label.objetoConvenio']}: " for="objetoConvenio" styleClass="text-input" />
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="objetoConvenio" value="#{obraEditMB.bean.objetoConvenio}" size="10"  
							title="#{messages['obra.alt.objetoConvenio']}" />
						<p:message for="objetoConvenio" />
					</h:panelGrid>   	

					<h:outputLabel value="#{messages['obra.label.numeroConvenio']}: " for="numeroConvenio" styleClass="text-input" />
					<h:panelGrid columns="8">
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="numeroConvenio" value="#{obraEditMB.bean.numeroConvenio}" size="10"  
							title="#{messages['obra.alt.numeroConvenio']}" />
						<p:message for="numeroConvenio" />
						<h:outputLabel value="#{messages['obra.label.valorTipoFonteRecursos']}: " for="valorTipoFonteRecursos" styleClass="text-input" />
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="valorTipoFonteRecursos" value="#{obraEditMB.bean.valorTipoFonteRecursos}" size="10"  
							title="#{messages['obra.alt.valorTipoFonteRecursos']}" />
						<p:message for="valorTipoFonteRecursos" />
						<h:outputLabel value="#{messages['obra.label.valorRepasse']}: " for="valorRepasse" styleClass="text-input" />
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="valorRepasse" value="#{obraEditMB.bean.valorRepasse}" size="10"  
							title="#{messages['obra.alt.valorRepasse']}" />
						<p:message for="valorRepasse" />
					</h:panelGrid>   	
				
					<h:outputLabel value="#{messages['obra.label.situacaoObra']}: " for="situacaoObra" styleClass="text-input" />
					<h:panelGrid columns="2">
						<h:selectOneMenu value="#{obraEditMB.situacaoObra}" id="situacaoObra" style="width: 200px;"
							title="#{messages['obra.label.situacaoObra']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.situacaoObras}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="situacaoObra" />
					</h:panelGrid>   	

					<h:outputLabel value="#{messages['obra.label.numeroCEI']}: " for="numeroCEI" styleClass="text-input" />
					<h:panelGrid columns="5">
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="numeroCEI" value="#{obraEditMB.bean.numeroCEI}"
							title="#{messages['obra.alt.numeroCEI']}" />
						<p:message for="numeroCEI" />

						<h:outputLabel value="#{messages['obra.label.dataValidadeCEI']}: " for="dataValidadeCEI" styleClass="text-input" />
						<p:calendar id="dataValidadeCEI" value="#{obraEditMB.bean.dataValidadeCEI}" size="15"
						   pattern="#{messages['label.date.pattern']}" navigator="true" showButtonPanel="true"
						   locale="#{currentLocale}" title="#{messages['obra.alt.dataValidadeCEI']}" />
					    <p:message for="dataValidadeCEI" />
					</h:panelGrid>

					<h:outputLabel value="#{messages['obra.label.tipoArt']}: " for="tipoART" styleClass="text-input" />
					<h:panelGrid columns="8">
						<h:selectOneMenu value="#{obraEditMB.tipoART}" id="tipoART" style="width: 170px;"
							title="#{messages['obra.label.tipoArt']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.tipoARTs}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="tipoART" />

						<h:outputLabel value="#{messages['obra.label.numeroArt']}: " for="numeroArt" styleClass="text-input" />
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="numeroArt" value="#{obraEditMB.bean.numeroArt}"
							title="#{messages['obra.alt.numeroArt']}" />
						<p:message for="numeroArt" />

						<h:outputLabel value="#{messages['obra.label.valiadeArt']}: " for="valiadeArt" styleClass="text-input" />
						<p:calendar id="valiadeArt" value="#{obraEditMB.bean.valiadeArt}"  size="15"
						   pattern="#{messages['label.date.pattern']}" navigator="true" showButtonPanel="true"
						   locale="#{currentLocale}" title="#{messages['obra.alt.valiadeArt']}" />
						   <p:message for="valiadeArt" />
					</h:panelGrid>

				</h:panelGrid>


<!-- 					<h:outputLabel value="#{messages['obra.label.dataEmissaoTermoConclusaoProvisorio']}: " for="dataEmissaoTermoConclusaoProvisorio" styleClass="text-input" /> -->
<!-- 					<p:calendar id="dataEmissaoTermoConclusaoProvisorio" value="#{obraEditMB.bean.dataEmissaoTermoConclusaoProvisorio}" -->
<!-- 					   pattern="#{messages['label.date.pattern']}" navigator="true" showButtonPanel="true" -->
<!-- 					   locale="#{currentLocale}" title="#{messages['obra.alt.dataEmissaoTermoConclusaoProvisorio']}" /> -->
<!-- 					   <p:message for="dataEmissaoTermoConclusaoProvisorio" /> -->
								
<!-- 					<h:outputLabel value="#{messages['obra.label.dataEmissaoTermoConclusaoDefinitivo']}: " for="dataEmissaoTermoConclusaoDefinitivo" styleClass="text-input" /> -->
<!-- 					<p:calendar id="dataEmissaoTermoConclusaoDefinitivo" value="#{obraEditMB.bean.dataEmissaoTermoConclusaoDefinitivo}" -->
<!-- 					   pattern="#{messages['label.date.pattern']}" navigator="true" showButtonPanel="true" -->
<!-- 					   locale="#{currentLocale}" title="#{messages['obra.alt.dataEmissaoTermoConclusaoDefinitivo']}" /> -->
<!-- 					   <p:message for="dataEmissaoTermoConclusaoDefinitivo" /> -->
								
					
					
					
					
					
					
					
					
<!-- 					<h:outputLabel value="#{messages['obra.label.listaItemTabelaPrecoObra']}: " for="listaItemTabelaPrecoObra" styleClass="text-input" /> -->
<!-- 					<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="listaItemTabelaPrecoObra" value="#{obraEditMB.bean.listaItemTabelaPrecoObra}" -->
<!-- 						title="#{messages['obra.alt.listaItemTabelaPrecoObra']}" /> -->
<!-- 					<p:message for="listaItemTabelaPrecoObra" /> -->
					
<!-- 					<h:outputLabel value="#{messages['obra.label.listaObraItemExigenciaTipoObra']}: " for="listaObraItemExigenciaTipoObra" styleClass="text-input" /> -->
<!-- 					<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="listaObraItemExigenciaTipoObra" value="#{obraEditMB.bean.listaObraItemExigenciaTipoObra}" -->
<!-- 						title="#{messages['obra.alt.listaObraItemExigenciaTipoObra']}" /> -->
<!-- 					<p:message for="listaObraItemExigenciaTipoObra" /> -->
					
<!-- 					<h:outputLabel value="#{messages['obra.label.listaDocumentosObra']}: " for="listaDocumentosObra" styleClass="text-input" /> -->
<!-- 					<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="listaDocumentosObra" value="#{obraEditMB.bean.listaDocumentosObra}" -->
<!-- 						title="#{messages['obra.alt.listaDocumentosObra']}" /> -->
<!-- 					<p:message for="listaDocumentosObra" /> -->
					
<!-- 					<h:outputLabel value="#{messages['obra.label.listaBoletimMedicao']}: " for="listaBoletimMedicao" styleClass="text-input" /> -->
<!-- 					<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="listaBoletimMedicao" value="#{obraEditMB.bean.listaBoletimMedicao}" -->
<!-- 						title="#{messages['obra.alt.listaBoletimMedicao']}" /> -->
<!-- 					<p:message for="listaBoletimMedicao" /> -->
					
<!-- 					<h:outputLabel value="#{messages['obra.label.listaComposicaoBDI']}: " for="listaComposicaoBDI" styleClass="text-input" /> -->
<!-- 					<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="listaComposicaoBDI" value="#{obraEditMB.bean.listaComposicaoBDI}" -->
<!-- 						title="#{messages['obra.alt.listaComposicaoBDI']}" /> -->
<!-- 					<p:message for="listaComposicaoBDI" /> -->

<!-- 				</p:panelGrid> -->
			</p:fieldset>
		</h:form>

		<p:spacer height="20" width="20"/>  

		<h:form prependId="false">
			<p:fieldset legend="#{messages['obra.label.itens']}" toggleable="true" toggleSpeed="500">

				<h:panelGrid columns="2"  id="fields2" >
					<h:outputLabel value="#{messages['obra.label.tabelaPreco']}: " for="tabelaPreco" styleClass="text-input" />
					<h:panelGrid columns="2">
						<h:selectOneMenu value="#{obraEditMB.tabelaPreco}" id="tabelaPreco" style="width: 470px;"
							title="#{messages['obra.label.tabelaPreco']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.tabelaPrecos}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="tabelaPreco" />
			        </h:panelGrid>

					<h:outputLabel value="#{messages['obra.label.itemTabelaPreco']}: " for="itemTabelaPreco" styleClass="text-input" />
					<h:panelGrid columns="3">
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="codigoItem" value="#{obraEditMB.codigoItem}" size="10"
							title="#{messages['obra.label.itemTabelaPreco']}" >
						</h:inputText>
						<h:selectOneMenu value="#{obraEditMB.itemTabelaPreco}" id="itemTabelaPreco" style="width: 670px;"
							title="#{messages['obra.label.itemTabelaPreco']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.itemTabelaPrecos}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="itemTabelaPreco" />
			        </h:panelGrid>

					<h:outputLabel value="#{messages['obra.label.agrupamentoItem']}: " for="agrupamentoItem" styleClass="text-input" />
					<h:panelGrid columns="5">
						<h:selectOneMenu value="#{obraEditMB.agrupamentoItem}" id="agrupamentoItem" style="width: 270px;"
							title="#{messages['obra.label.agrupamentoItem']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.agrupamentoItems}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="agrupamentoItem" />

						<h:outputLabel value="#{messages['obra.label.localItem']}: " for="localItem" styleClass="text-input" />
						<h:selectOneMenu value="#{obraEditMB.localItem}" id="localItem" style="width: 270px;"
							title="#{messages['obra.label.localIitem']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.localItems}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="localItem" />
			        </h:panelGrid>

					<h:outputLabel value="#{messages['obra.label.bdi']}: " for="bdi" styleClass="text-input" />
					<h:panelGrid columns="8">
						<h:selectOneMenu value="#{obraEditMB.bdi}" id="bdi" style="width: 150px;"
							title="#{messages['obra.label.periodoInicialItem']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.bdis}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="bdi" />

						<p:spacer/>  
						<p:spacer/>  
						<p:spacer/>  

					    <h:commandButton value="#{messages['obra.label.cadastrarBDI']}"  action="#" actionListener="#{obraEditMB.adicionarBDI()}" ajax="true" >
				    		<f:ajax execute="bdi" render="bdi" />
				    	</h:commandButton>
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="bdiCadastro" value="#{obraEditMB.bdiCadastro}" size="10"
							title="#{messages['obra.label.bdiCadastro']}" >
						</h:inputText>
					    <p:message for="bdiCadastro" />
			        </h:panelGrid>

					<h:outputLabel value="#{messages['obra.label.quantidade']}: " for="quantidade" styleClass="text-input" />
					<h:panelGrid columns="8">
						<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="quantidade" value="#{obraEditMB.quantidade}" size="10"
							title="#{messages['obra.label.quantidade']}" >
						</h:inputText>
					    <p:message for="quantidade" />

						<h:outputLabel value="#{messages['obra.label.periodoInicialItem']}: " for="periodoInicialItem" styleClass="text-input" />
						<h:selectOneMenu value="#{obraEditMB.periodoInicialItem}" id="periodoInicialItem" style="width: 150px;"
							title="#{messages['obra.label.periodoInicialItem']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.periodos}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="periodoInicialItem" />

						<h:outputLabel value="#{messages['obra.label.periodoFinalItem']}: " for="periodoFinalItem" styleClass="text-input" />
						<h:selectOneMenu value="#{obraEditMB.localItem}" id="periodoFinalItem" style="width: 150px;"
							title="#{messages['obra.label.periodoFinalItem']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.periodos}"></f:selectItems>
						</h:selectOneMenu>
					    <p:message for="periodoFinalItem" />
			        </h:panelGrid>



					<f:facet name="footer">
				    	<h:panelGroup>
							<h:commandButton value="#{messages['button.add']}"  action="#{botaoEditMB.adicionarPorta}" ajax="true" >
				    			<f:ajax execute="fields2" render="fields2" />
				    	   	</h:commandButton>

							<p:message for="listItem"/>
							<p:dataTable id="listItem" var="bean" value="#{obraEditMB.bean.listaItemTabelaPrecoObra}" rowIndexVar="rowIndex" >
								<f:facet name="header">#{messages['obra.itens.list.table.title']}</f:facet>
			
								<p:column style="width:5%;" sortBy="#{rowIndex}">
									<f:facet name="header">#{messages['button.remove']}</f:facet>
									<h:commandButton value="#{messages['button.remove']}" action="#{obraEditMB.removerItens()}" ajax="true" >
						    			<f:ajax execute="list" render="list" immediate="true"/>
										<f:setPropertyActionListener target="#{obraEditMB.posicaoItem}" value="#{rowIndex}" />
									</h:commandButton>
								</p:column>
			
								<p:column sortBy="#{bean.agrupamentoItem.descricao}">
									<f:facet name="header">#{messages['obra.label.agrupamentoItem']}</f:facet>
										<h:outputText value="#{bean.agrupamentoItem.descricao}" />
								</p:column>
			
								<p:column sortBy="#{bean.localItem.descricao}">
									<f:facet name="header">#{messages['obra.label.localItem']}</f:facet>
										<h:outputText value="#{bean.localItem.descricao}" />
								</p:column>
			
								<p:column sortBy="#{bean.itemTabelaPreco.descricao}">
									<f:facet name="header">#{messages['obra.label.itemTabelaPreco']}</f:facet>
										<h:outputText value="#{bean.itemTabelaPreco.descricao}" />
								</p:column>
			
								<p:column sortBy="#{bean.itemTabelaPreco.unidade.descricao}" width="20">
									<f:facet name="header">#{messages['obra.label.unidadeMedida']}</f:facet>
										<h:outputText value="#{bean.itemTabelaPreco.unidade.descricao}" />
								</p:column>
			
								<p:column sortBy="#{bean.itemTabelaPreco.valorUnitario}" width="20">
									<f:facet name="header">#{messages['obra.label.valorUnitario']}</f:facet>
										<h:outputText value="#{bean.itemTabelaPreco.valorUnitario}" />
								</p:column>
			
								<p:column sortBy="#{bean.periodoInicial}">
									<f:facet name="header">#{messages['obra.label.periodoInicialItem']}</f:facet>
										<h:outputText value="#{bean.periodoInicial}" />
								</p:column>
			
								<p:column sortBy="#{bean.periodoFinal}">
									<f:facet name="header">#{messages['obra.label.periodoFinalItem']}</f:facet>
										<h:outputText value="#{bean.periodoFinal}" />
								</p:column>
			
								<p:column sortBy="#{bean.quantidade}" width="20">
									<f:facet name="header">#{messages['obra.label.quantidade']}</f:facet>
										<h:outputText value="#{bean.quantidade}" />
								</p:column>
			
								<p:column sortBy="#{bean.valorUnitarioComBDI }" width="20">
									<f:facet name="header">#{messages['obra.label.valorUnitarioComBDI']}</f:facet>
										<h:outputText value="#{bean.valorUnitarioComBDI}" />
								</p:column>
			
								<p:column sortBy="#{bean.valorFinalItem}" width="20">
									<f:facet name="header">#{messages['obra.label.valorFinalItem']}</f:facet>
										<h:outputText value="#{bean.valorFinalItem}" />
								</p:column>
							</p:dataTable>
	
							<br/>
	
							<h:commandButton value="#{messages['button.exportarCronograma']}" action="#" ajax="true" actionListener="#{obraEditMB.exportarCronograma}" >
				    			<f:ajax execute="fields2" render="fields2" />
				    	   	</h:commandButton>
				    	</h:panelGroup>
				    </f:facet>	
				</h:panelGrid>
			</p:fieldset>
		</h:form>

		<p:spacer height="20" width="20"/>  

		<h:form prependId="false">
			<p:fieldset legend="#{messages['obra.label.exigencia']}" toggleable="true" toggleSpeed="500">
				<h:panelGroup id="pgExigencia">
				
					<h:panelGrid columns="3"  id="fields3" >
						<h:outputLabel value="#{messages['obra.label.tipoObra']}: " for="tipoObra" styleClass="text-input" />
						<h:selectOneMenu value="#{obraEditMB.tipoObra}" id="tipoObra" style="width: 470px;"
							title="#{messages['obra.label.tipoObra']}" required="true"
							requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}">
							<f:selectItem itemLabel="Selecione" itemValue="" />	
	 						<f:selectItems value="#{obraEditMB.tipoObras}"></f:selectItems>
					             <p:ajax listener="#{obraEditMB.carregarExigencias()}" 
					             	update="listExigencia, pgExigencia" />    
						</h:selectOneMenu>
					    <p:message for="tipoObra" />
	
						<f:facet name="footer">
					    	<h:panelGroup>
	
								<p:message for="listExigencia"/>
								<p:dataTable id="listExigencia" var="bean" value="#{obraEditMB.exigencias}" rowIndexVar="rowIndex" >
									<f:facet name="header">#{messages['obra.exigencias.list.table.title']}</f:facet>
	
									<p:column sortBy="#{bean.codigoExigencia}" width="50">
										<f:facet name="header">#{messages['obra.label.exigencia.codigo']}</f:facet>
											<h:outputText value="#{bean.codigoExigencia}" />
									</p:column>
				
									<p:column sortBy="#{bean.descricao}">
										<f:facet name="header">#{messages['obra.label.exigencia.descricao']}</f:facet>
											<h:outputText value="#{bean.descricao}" />
									</p:column>
	
									<p:column sortBy="#{bean.obrigatorio}">
										<f:facet name="header">#{messages['obra.label.exigencia.obrigatorio']}</f:facet>
											<h:outputText value="Sim" rendered="#{bean.obrigatorio eq 'S'} " />
											<h:outputText value="Não" rendered="#{bean.obrigatorio eq 'N'} " />
									</p:column>
	
									<p:column>
										<f:facet name="header">#{messages['obra.label.exigencia.selecionar']}</f:facet>
										<h:selectBooleanCheckbox value="#{obraEditMB.checkMap[bean]}"/>
									</p:column>
	
								</p:dataTable>
					    	</h:panelGroup>
					    </f:facet>	
					</h:panelGrid>
				</h:panelGroup>
			</p:fieldset>
		</h:form>

		<p:spacer height="20" width="20"/>  

		<h:form prependId="false">
			<p:fieldset legend="#{messages['obra.label.documentos']}" toggleable="true" toggleSpeed="500">
				<h:panelGroup id="pgDocumeneto">
					<h:panelGrid columns="2"  id="fields4" >

						<h:outputLabel value="#{messages['obra.label.descricaoArquivo']}: " for="descricaoArquivo" styleClass="text-input" />
						<h:panelGrid columns="2">
							<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="descricaoArquivo" value="#{obraEditMB.descricaoArquivo}" size="40"
								title="#{messages['obra.label.descricaoArquivo']}" >
							</h:inputText>
						    <p:message for="descricaoArquivo" />
						</h:panelGrid>
	
						<h:outputLabel value="#{messages['obra.label.nomeArquivo']}: " for="nomeArquivo" styleClass="text-input" />
						<h:panelGrid columns="3">
							<h:inputText required="true" requiredMessage="#{messages['mensagem_geral.campoObrigatorio']}"  id="nomeArquivo" value="#{obraEditMB.nomeArquivo}" size="30"
								title="#{messages['obra.label.nomeArquivo']}" >
							</h:inputText>
						    <p:message for="nomeArquivo" />
								<h:commandButton value="#{messages['button.selecionarArquivo']}"  actionListener="#{botaoEditMB.adicionarDocumento}" ajax="true" >
					    			<f:ajax execute="fields4" render="fields4" />
					    	   	</h:commandButton>
						</h:panelGrid>
	
						<f:facet name="footer">
					    	<h:panelGroup>
								<h:commandButton value="#{messages['button.add']}"  action="#{botaoEditMB.adicionarDocumento}" ajax="true" >
					    			<f:ajax execute="fields4" render="fields4" />
					    	   	</h:commandButton>

								<p:message for="listDocumentos"/>
								<p:dataTable id="listDocumentos" var="bean" value="#{obraEditMB.bean.listaDocumentosObra}" rowIndexVar="rowIndex" >
									<f:facet name="header">#{messages['obra.documentos.list.table.title']}</f:facet>

									<p:column style="width:5%;" sortBy="#{rowIndex}">
										<f:facet name="header">#{messages['button.remove']}</f:facet>
										<h:commandButton value="#{messages['button.remove']}" action="#{obraEditMB.removerDocumento()}" ajax="true" >
							    			<f:ajax execute="list" render="list" immediate="true"/>
											<f:setPropertyActionListener target="#{obraEditMB.posicaoDocumento}" value="#{rowIndex}" />
										</h:commandButton>
									</p:column>
									
	
									<p:column sortBy="#{bean.nomeDocumento}">
										<f:facet name="header">#{messages['obra.label.descricaoArquivo']}</f:facet>
											<h:outputText value="#{bean.nomeDocumento}" />
									</p:column>

									<p:column sortBy="#{bean.nomeArquivo}">
										<f:facet name="header">#{messages['obra.label.nomeArquivo']}</f:facet>
											<h:outputText value="#{bean.nomeArquivo}" />
									</p:column>
	
								</p:dataTable>
					    	</h:panelGroup>
					    </f:facet>	

					</h:panelGrid>
				</h:panelGroup>	
			</p:fieldset>
		</h:form>

	</ui:define>
</ui:composition>